﻿using System;
using System.Windows;
using System.Windows.Data;
using System.Globalization;

namespace MobiSms.Converters
{
    public class ResourceKeyToPathdataConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                string pathString = Application.Current.Resources[value] as string;
                return new StringToPathGeometryConverter().Convert(pathString);
            }
            catch
            {
                return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
